# __coding:utf-8__
from urllib.request import urlopen;
import requests;
import json;

param = {'username': 'admin', 'password': '***'};
r = requests.post('http://www.furong.link/?route=admin/Login', data=param)
print(r.cookies.get_dict());
# 带cookie上传文件
# files = {'uploadFile': open('D:/www/github/python_work/caiji_work/upload/2beabdb9b57f90c5faf4d4fdddbf1ad7_350_198.jpg','rb')};
# r = requests.post('http://www.furong.link/?route=admin/Upload/index', files=files,cookies=r.cookies);
# print(r.text);
# print(json.loads(r.text));
# 带cookie请求页面
r = requests.get('http://www.furong.link/?route=admin/Cms/editPost&id=58', cookies=r.cookies)
print(r.text);
# 获取页面session
session = requests.Session();
param = {'username': 'admin', 'password': '***'};
r = session.post('http://www.furong.link/?route=admin/Login', data=param)
s = session.get('http://www.furong.link/?route=admin/Cms/editPost&id=58')
print(s.text);
